﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace QuanLyCongViec.Common
{
    public class Util
    {
        private const string TITLE_INFO_BOX = "Thông báo";
        private const string TITLE_ERR_BOX = "Lỗi";
       
        public static void ShowMessageBox(string msg)
        {
            MessageBox.Show(msg, TITLE_INFO_BOX, MessageBoxButtons.OK, MessageBoxIcon.Information);
        }

        public static void ShowErrorMsgBox(string msg)
        {
            MessageBox.Show(msg, TITLE_ERR_BOX, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static bool ShowMessageBoxQuestion(string msg)
        {
            if ((MessageBox.Show(msg, TITLE_INFO_BOX, MessageBoxButtons.OKCancel, MessageBoxIcon.Information) == DialogResult.OK))
            {
                return true;
            }
            return false;
        }

        public static bool ShowMsgBoxWarningQuestion(string msg)
        {
            if ((MessageBox.Show(msg, TITLE_INFO_BOX, MessageBoxButtons.OKCancel, MessageBoxIcon.Warning) == DialogResult.OK))
            {
                return true;
            }
            return false;
        }

        public static void ShowErrorMsgBox(string title, string msg)
        {
            MessageBox.Show(msg, title, MessageBoxButtons.OK, MessageBoxIcon.Error);
        }

        public static void ShowWarningMsgBox(string msg)
        {
            MessageBox.Show(msg, TITLE_INFO_BOX, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }

        public static void ShowWarningMsgBox(string title, string msg)
        {
            MessageBox.Show(msg, title, MessageBoxButtons.OK, MessageBoxIcon.Warning);
        }
    }
}
